Skip to content

Added opt-in pointer callback mode and pointer creation APIs - #819

Open
Dev10-sys wants to merge 1 commit into
eclipse-threadx:devfrom
Dev10-sys:feature/pointer-callback-mode
Open

Dev10-sys wants to merge 1 commit into
eclipse-threadx:devfrom
Dev10-sys:feature/pointer-callback-mode

Conversation

@Dev10-sys

@Dev10-sys Dev10-sys commented Oct 22, 2026 •

Copy link
Copy Markdown

Fixes #771, fixes #772

In 64-bit systems, pointers were getting cut off when passed to thread and timer callbacks because ThreadX was using 32-bit ULONG for them. To solve this without breaking any old code, I changed the internal callback parameter fields to ALIGN_TYPE so they can hold a full 64-bit pointer. I added new tx_thread_create_ptr and tx_timer_create_ptr functions to pass pointer contexts safely, and added the TX_ENABLE_POINTER_CALLBACKS option to let users use pointers with the standard create functions. I updated both the regular and SMP code, tested the builds, and confirmed that pointer contexts are now passed properly without any truncation.

@Dev10-sys
Dev10-sys force-pushed the feature/pointer-callback-mode branch from 64d91fb to 47344b9 Compare October 23, 2026 05:41
@fdesbiens

Copy link
Copy Markdown
Contributor

Thanks @Dev10-sys. I will look into it next week.

…-threadx#771, eclipse-threadx#772)

Support passing full pointer-width context arguments to thread and timer
callbacks on 64-bit architectures without truncation, while maintaining
full backward compatibility for existing 32-bit ULONG callbacks.

- Added tx_thread_create_ptr and tx_timer_create_ptr APIs for direct
  pointer context callbacks.
- Added pointer entry and timeout fields in thread and timer control
  blocks with automatic dispatch in shell entry and timer threads.
- Added TX_ENABLE_POINTER_CALLBACKS configuration option to allow
  transparent pointer passing with standard create APIs.
- Preserved existing ULONG callback signatures across all ports and
  module manager interfaces.
- Added regression tests covering 64-bit pointer argument transmission,
  error detection paths, and backward compatibility in both standard
  and SMP builds.

Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>
@Dev10-sys
Dev10-sys force-pushed the feature/pointer-callback-mode branch from 47344b9 to 688f56a Compare October 24, 2026 07:01

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants